<!DOCTYPE html>
<html lang="en">
<head>
	<meta charset="UTF-8">
	<title>Document</title>
</head>
<body>
	<center>
	    <h2>距离结束还有:<span id="hour">时</span><span id="min">分</span><span id="se">秒</span></h2>
		<table border="1" width="800px">
			<tr>
				<td>商品名称</td>
				<td>商品价格 </td>
				<td>商品库存</td>
				<td>开始时间</td>
				<td>结束时间</td>
				<td>商品图片</td>
				<td>操作</td>
			</tr>
			<?php foreach ($res as $key => $value) {?>
			<tr>
				<td><?php echo $value["g_name"];?></td>
				<td><?php echo $value["g_price"];?></td>
				<td><?php echo $value["g_stock"];?></td>
				<td><?php echo $value["starttime"];?></td>
				<td><?php echo $value["endtime"];?></td>
				<td><img src="<?php echo $value['g_img'];?>" width="100px" height="100px"></td>
				<td>
					<a href="qg.php?id=<?php echo $value['g_id'];?>">抢购</a>
				</td>
			</tr>
			<?php }?>
		</table>
	</center>
</body>
</html>
<script src="http://apps.bdimg.com/libs/jquery/2.1.4/jquery.min.js"></script>
<script>
	setInterval(function(){

       $.getJSON("time.php","",function(e){

          $("#hour").html(e.hour+"时"); 
          $("#min").html(e.minute+"分"); 
          $("#se").html(e.m+"秒"); 
       })
	}, 1000)
</script>